package servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Servlet01 extends HttpServlet {
	private String charset;
	public Servlet01() {
		System.out.println("servlet created****************8");
	}
	@Override
	public void init(ServletConfig config) throws ServletException {
		super.init();
		System.out.println("@@@@@@@@@@@@@@@@@@@@@@init");
		this.charset=config.getInitParameter("charset");
	}
	@Override
	protected void service(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		response.setContentType("text/html;charset="+charset);
		PrintWriter out = response.getWriter();
		out.print("service normarly");
	}
	@Override
	public void destroy() {
		super.destroy();
		System.out.println("&&&&&&&destry");
	}
}
